import matplotlib as mpl
mpl.rcParams['font.sans-serif'] = ['KaiTi']
mpl.rcParams['font.serif'] = ['KaiTi']
mpl.rcParams['font.size'] =8
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams['axes.unicode_minus'] = False

font2 = {'family' : 'KaiTi',
'weight' : 'normal',
'size'   : 15,
}


data1=pd.read_csv('./凡口误差废石.csv',header=None)
print(data1)

data2=pd.read_csv('./凡口误差黄铁.csv',header=None)
print(data2)

data3=pd.read_csv('./凡口误差铅锌.csv',header=None)
print(data3)

x1=[i for i in range(1,16)]
x2=[i for i in range(16,31)]
x3=[i for i in range(31,46)]

print(x1,'\n',x2,'\n',x3)

y1=data1[0].tolist()
y2=data2[0].tolist()
y3=data3[0].tolist()
print(y1,'\n',y2,'\n',y3)

A,=plt.plot(x1, y1,color='r',label="废石")
B,=plt.plot(x2, y2,color='g',label="黄铁")
C,=plt.plot(x3, y3,color='b',label="铅锌")
plt.xlabel("石头的标号",font2)
plt.ylabel("拟合误差%",font2)

legend = plt.legend(handles=[A,B,C],prop=font2)
plt.show()